﻿
/*
 @    Author : Rich of BeastModeMS
 @
 @    NPC = Mr. Oh
 @    Map =  MAP
 @    NPC MapId = MAPID
 @    Function = All in one Shop
 @
 */
var itemList = Array(
2434503, //咒文的痕跡 100個交換券
2434503, //咒文的痕跡 100個交換券
5121057,//氣像效果
2434502,//名譽勳章
2049004,//純白咒文書
2048716,//輪迴星火
2048311,//潛能附加卷軸
2049705,//稀有潛在
2434390,//傷害造型
2434391,//傷害造型
3015276,//椅子
3015277,
3015278,
3015279,
2434389,//寵物交換卷
1050388,//烏勒斯男用西裝
1051458, //烏勒斯女用西裝
1004597,//帽子
1082666,//手套
1073090,//鞋子
1004598,
1082667,
1073091,
1004599,
1082668,
1073092,
2434470
);//25
var status = 0;
var input = 0;
var statusA = 0;
var ed = false;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    var nx = cm.getChar().getCSPoints(1);
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0 && status == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (ed == true && !cm.getPlayer().isGM()) {
            cm.sendOk("兌換NPC維修中，若造成不便請多多包涵。");
            cm.dispose();
            return;
        }
        if (status == 0) {


       
var text = "";
      

		for(var i=1; i<itemList.length; i++) {
			text+="#L"+i+"##i"+itemList[i]+"##z"+itemList[i]+"#\r\n";
		}



 cm.sendOk("要兌換哪個呢?\r\n"+text);

 


                          
        } else if (status == 1) {
            if (selection == 1) {
                              cm.sendSimple("兌換#i2434503##r#z2434503##k\r\n需要以下物品\r\n\r\n"+ 
"#i4009354# 6個 /擁有#c4009354#個\r\n"+
"#i4009355# 6個 /擁有#c4009355#個\r\n"+
"#i4009356# 3個 /擁有#c4009356#個\r\n"+
" #b#L1#兌換");
                }

             else if (selection == 2) {
                              cm.sendSimple("兌換#i5121057##r#z5121057##k\r\n需要以下物品\r\n\r\n"+ 
"#i4009354# 2個 /擁有#c4009354#個\r\n"+
"#i4009355# 2個 /擁有#c4009355#個\r\n"+
"#i4009356# 1個 /擁有#c4009356#個\r\n"+
"#b#L2#兌換");
     
                         } else if (selection == 3) {
                              cm.sendSimple("兌換#i2434502##r#z2434502##k\r\n需要以下物品\r\n\r\n"+
"#i4009354# 10個 /擁有#c4009354#個\r\n"+
"#i4009355# 10個 /擁有#c4009355#個\r\n"+
"#i4009356# 5個 /擁有#c4009356#個\r\n"+
"#i4009345# 10個 /擁有#c4009345#個\r\n"+
"#i4009351# 5個 /擁有#c4009351#個\r\n"+
"\r\n#b#L3#兌換");
                                    
                      } else if (selection == 4) {
                              cm.sendSimple("兌換#i2049004##r#z2049004##k\r\n需要以下物品\r\n\r\n"+
"#i4009354# 30個 /擁有#c4009354#個\r\n"+
"#i4009355# 30個 /擁有#c4009355#個\r\n"+
"#i4009356# 15個 /擁有#c4009356#個\r\n"+
"#i4009346# 10個 /擁有#c4009346#個\r\n"+
"#i4009352# 4個 /擁有#c4009352#個\r\n"+
"#b#L4#兌換");
                           
                      } else if (selection == 5) {
                              cm.sendSimple("兌換#i2048716##r#z2048716##k\r\n需要以下物品\r\n\r\n"+
"#i4009354# 40個 /擁有#c4009354#個\r\n"+
"#i4009355# 40個 /擁有#c4009355#個\r\n"+
"#i4009356# 20個 /擁有#c4009356#個\r\n"+
"#i4009347# 5個 /擁有#c4009347#個\r\n"+
"#i4009350# 1個 /擁有#c4009350#個\r\n"+
"\r\n#b#L5#兌換");
                          
                      } else if (selection == 6) {
                              cm.sendSimple("兌換#i2048311##r#z2048311##k\r\n需要以下物品\r\n\r\n"+
"#i4009354# 40個 /擁有#c4009354#個\r\n"+
"#i4009355# 40個 /擁有#c4009355#個\r\n"+
"#i4009356# 25個 /擁有#c4009356#個\r\n"+
"#i4009348# 3個 /擁有#c4009348#個\r\n"+
"#i4009349# 1個 /擁有#c4009349#個\r\n"+
"#b#L6#兌換");
                          
                      } else if (selection == 7) {
                              cm.sendSimple("兌換#i2049705##r#z2049705##k\r\n需要以下物品\r\n\r\n"+
"#i4009354# 30個 /擁有#c4009354#個\r\n"+
"#i4009355# 30個 /擁有#c4009355#個\r\n"+
"#i4009356# 20個 /擁有#c4009356#個\r\n"+
"#i4009348# 3個 /擁有#c4009348#個\r\n"+
"#i4009353# 10個 /擁有#c4009353#個\r\n"+
"#b#L7#兌換");
                           
                      } else if (selection == 8) {
                              cm.sendSimple("兌換#i2434390##r#z2434390##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 40個 /擁有#c4009356#個\r\n"+
                                            "#i4009346# 60個 /擁有#c4009346#個\r\n"+
                                            "#i4009348# 20個 /擁有#c4009348#個\r\n"+
                                            "#i4009351# 30個 /擁有#c4009351#個\r\n"+
                                            "#i4009352# 20個 /擁有#c4009352#個\r\n"+
                                            "#i4009353#  5個 /擁有#c4009353#個\r\n"+
                                            "#b#L8#兌換");
                          
                      } else if (selection == 9) {
                              cm.sendSimple("兌換#i2434390##r#z2434390##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 50個 /擁有#c4009356#個\r\n"+
                                            "#i4009346# 60個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 30個 /擁有#c4009347#個\r\n"+
                                            "#i4009351# 30個 /擁有#c4009351#個\r\n"+
                                            "#i4009352# 20個 /擁有#c4009352#個\r\n"+
                                            "#i4009353#  5個 /擁有#c4009353#個\r\n"+
                                            "#b#L9#兌換");
                     } else if (selection == 10) {
                              cm.sendSimple("兌換#i3015276##r#z3015276##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009355# 60個 /擁有#c4009355#個\r\n"+
                                            "#i4009356# 30個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 60個 /擁有#c4009345#個\r\n"+
                                            "#i4009347# 20個 /擁有#c4009347#個\r\n"+
                                            "#i4009351# 40個 /擁有#c4009351#個\r\n"+
                                            "#b#L10#兌換");
                     } else if (selection == 11) {
                              cm.sendSimple("兌換#i3015277##r#z3015277##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009354# 60個 /擁有#c4009354#個\r\n"+
                                            "#i4009355# 40個 /擁有#c4009355#個\r\n"+
                                            "#i4009345# 50個 /擁有#c4009345#個\r\n"+
                                            "#i4009346# 50個 /擁有#c4009346#個\r\n"+
                                            "#i4009352# 30個 /擁有#c4009352#個\r\n"+
                                            "#b#L11#兌換");
                     } else if (selection == 12) {
                              cm.sendSimple("兌換#i3015278##r#z3015278##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009354# 80個 /擁有#c4009354#個\r\n"+
                                            "#i4009356# 35個 /擁有#c4009356#個\r\n"+
                                            "#i4009347# 35個 /擁有#c4009347#個\r\n"+
                                            "#i4009349#  5個 /擁有#c4009349#個\r\n"+
                                            "#i4009353# 10個 /擁有#c4009353#個\r\n"+
                                            "#b#L12#兌換");
                      } else if (selection == 13) {
                              cm.sendSimple("兌換#i3015279##r#z3015279##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009355# 100個 /擁有#c4009355#個\r\n"+
                                            "#i4009356# 40個 /擁有#c4009356#個\r\n"+
                                            "#i4009346# 60個 /擁有#c4009346#個\r\n"+
                                            "#i4009348# 20個 /擁有#c4009348#個\r\n"+
                                            "#i4009350# 4個 /擁有#c4009350#個\r\n"+
                                            "#i4009353# 15個 /擁有#c4009353#個\r\n"+
                                            "#b#L13#兌換");
                      } else if (selection == 14) {
                              cm.sendSimple("兌換#i2434389##r#z2434389##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009345# 40個 /擁有#c4009356#個\r\n"+
                                            "#i4009346# 20個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 15個 /擁有#c4009347#個\r\n"+
                                            "#i4009351# 20個 /擁有#c4009351#個\r\n"+
                                            "#i4009352# 10個 /擁有#c4009352#個\r\n"+
                                            "#i4009353#  5個 /擁有#c4009353#個\r\n"+
                                            "#b#L14#兌換");
                      } else if (selection == 15) {
                              cm.sendSimple("兌換#i1050388##r#z1050388##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009345# 60個 /擁有#c4009345#個\r\n"+
                                            "#i4009349# 4個 /擁有#c4009349#個\r\n"+
                                            "#i4009350# 2個 /擁有#c4009350#個\r\n"+
                                            "#i4009351# 30個 /擁有#c4009351#個\r\n"+
                                            "#i4009352# 25個 /擁有#c4009352#個\r\n"+
                                            "#b#L15#兌換");
                } else if (selection == 16) {
                              cm.sendSimple("兌換#i1051458##r#z1051458##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009345# 60個 /擁有#c4009345#個\r\n"+
                                            "#i4009349# 4個 /擁有#c4009349#個\r\n"+
                                            "#i4009350# 2個 /擁有#c4009350#個\r\n"+
                                            "#i4009351# 30個 /擁有#c4009351#個\r\n"+
                                            "#i4009352# 25個 /擁有#c4009352#個\r\n"+
                                            "#b#L16#兌換");
                                        } else if (selection == 17) {
                              cm.sendSimple("兌換#i1004597##r#z1004597##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 60個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 60個 /擁有#c4009345#個\r\n"+
                                            "#i4009348# 30個 /擁有#c4009348#個\r\n"+
                                            "#i4009349# 8個 /擁有#c4009349#個\r\n"+
                                            "#i4009350# 4個 /擁有#c4009350#個\r\n"+
                                            "#i4009353# 30個 /擁有#c4009353#個\r\n"+
                                            "#b#L17#兌換");
                                      } else if (selection == 18) {
                              cm.sendSimple("兌換#i1082666##r#z1082666##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 20個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 40個 /擁有#c4009345#個\r\n"+
                                            "#i4009346# 20個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 16個 /擁有#c4009347#個\r\n"+
                                            "#i4009349# 1個 /擁有#c4009349#個\r\n"+
                                            "#i4009351# 10個 /擁有#c4009351#個\r\n"+
                                            "#b#L18#兌換");
                                   } else if (selection == 19) {
                              cm.sendSimple("兌換#i1073090##r#z1073090##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 25個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 40個 /擁有#c4009345#個\r\n"+
                                            "#i4009346# 30個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 20個 /擁有#c4009347#個\r\n"+
                                            "#i4009349# 1個 /擁有#c4009349#個\r\n"+
                                            "#i4009351# 30個 /擁有#c4009351#個\r\n"+
                                            "#b#L19#兌換");
                                        } else if (selection == 20) {
                              cm.sendSimple("兌換#i1004598##r#z1004598##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 60個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 60個 /擁有#c4009345#個\r\n"+
                                            "#i4009348# 30個 /擁有#c4009348#個\r\n"+
                                            "#i4009349# 8個 /擁有#c4009349#個\r\n"+
                                            "#i4009350# 4個 /擁有#c4009350#個\r\n"+
                                            "#i4009353# 30個 /擁有#c4009353#個\r\n"+
                                            "#b#L20#兌換");
                                      } else if (selection == 21) {
                              cm.sendSimple("兌換#i1082667##r#z1082667##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 20個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 40個 /擁有#c4009345#個\r\n"+
                                            "#i4009346# 20個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 16個 /擁有#c4009347#個\r\n"+
                                            "#i4009349# 1個 /擁有#c4009349#個\r\n"+
                                            "#i4009351# 10個 /擁有#c4009351#個\r\n"+
                                            "#b#L21#兌換");
                                   } else if (selection == 22) {
                              cm.sendSimple("兌換#i1073091##r#z1073091##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 25個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 40個 /擁有#c4009345#個\r\n"+
                                            "#i4009346# 30個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 20個 /擁有#c4009347#個\r\n"+
                                            "#i4009349# 1個 /擁有#c4009349#個\r\n"+
                                            "#i4009351# 30個 /擁有#c4009351#個\r\n"+
                                            "#b#L22#兌換");
                                        } else if (selection == 23) {
                              cm.sendSimple("兌換#i1004599##r#z1004599##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 60個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 60個 /擁有#c4009345#個\r\n"+
                                            "#i4009348# 30個 /擁有#c4009348#個\r\n"+
                                            "#i4009349# 8個 /擁有#c4009349#個\r\n"+
                                            "#i4009350# 4個 /擁有#c4009350#個\r\n"+
                                            "#i4009353# 30個 /擁有#c4009353#個\r\n"+
                                            "#b#L23#兌換");
                                      } else if (selection == 24) {
                              cm.sendSimple("兌換#i1082668##r#z1082668##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 20個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 40個 /擁有#c4009345#個\r\n"+
                                            "#i4009346# 20個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 16個 /擁有#c4009347#個\r\n"+
                                            "#i4009349# 1個 /擁有#c4009349#個\r\n"+
                                            "#i4009351# 10個 /擁有#c4009351#個\r\n"+
                                            "#b#L24#兌換");
                                   } else if (selection == 25) {
                              cm.sendSimple("兌換#i1073092##r#z1073092##k\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 25個 /擁有#c4009356#個\r\n"+
                                            "#i4009345# 40個 /擁有#c4009345#個\r\n"+
                                            "#i4009346# 30個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 20個 /擁有#c4009347#個\r\n"+
                                            "#i4009349# 1個 /擁有#c4009349#個\r\n"+
                                            "#i4009351# 30個 /擁有#c4009351#個\r\n"+
                                            "#b#L25#兌換");
                                    }else if (selection == 26) {
                              cm.sendSimple("兌換#i2591517##r#z02591517##k(注意:隨機能力!)\r\n需要以下物品\r\n\r\n"+
                                            "#i4009356# 60個 /擁有#c4009356#個\r\n"+
                                            "#i4009346# 70個 /擁有#c4009346#個\r\n"+
                                            "#i4009347# 30個 /擁有#c4009347#個\r\n"+
                                            "#i4009351# 30個 /擁有#c4009351#個\r\n"+
                                            "#i4009352# 20個 /擁有#c4009352#個\r\n"+
                                            "#i4009353# 5個 /擁有#c4009353#個\r\n"+
                                            "#b#L26#兌換");
                    

  }

        } else if (status == 2) {
for(var i=1; i<itemList.length; i++) {
	     if(!cm.canHold(itemList[i], 1)){
             cm.sendOk("您的背包滿了 請確認背包(裝備、消耗、其它、設置、特殊欄位)都有留一格空位");
             cm.dispose();
             return;   
             }
		}
            if (selection == 1) {
                if (cm.haveItem(4009354,6)&&cm.haveItem(4009355,6)&&cm.haveItem(4009356,3)) {
                    cm.gainItem(4009354, -6);
                    cm.gainItem(4009355, -6);
                    cm.gainItem(4009356, -3);
                    cm.gainItem(2434503, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
        
         } else if (selection == 2) {
                if (cm.haveItem(4009354,2)&&cm.haveItem(4009355,2)&&cm.haveItem(4009356,1)) {
                    cm.gainItem(4009354, -2);
                    cm.gainItem(4009355, -2);
                    cm.gainItem(4009356, -1);

                    cm.gainItem(5121057, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
         } else if (selection == 3) {
                if (cm.haveItem(4009354,10)&&cm.haveItem(4009355,10)&&cm.haveItem(4009356,5)&&cm.haveItem(4009345,10)&&cm.haveItem(4009351,5)) {
                    cm.gainItem(4009354, -10);
                    cm.gainItem(4009355, -10);
                    cm.gainItem(4009356, -5);
                    cm.gainItem(4009345, -10);
                    cm.gainItem(4009351, -5);
                    cm.gainItem(2434502, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
         } else if (selection == 4) {
                if (cm.haveItem(4009354,30)&&cm.haveItem(4009355,30)&&cm.haveItem(4009356,15)&&cm.haveItem(4009346,10)&&cm.haveItem(4009352,4)) {
                    cm.gainItem(4009354, -30);
                    cm.gainItem(4009355, -30);
                    cm.gainItem(4009356, -15);
                    cm.gainItem(4009346, -10);
                    cm.gainItem(4009352, -4);
                    cm.gainItem(2049004, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
         } else if (selection == 5) {
                if (cm.haveItem(4009354,40)&&cm.haveItem(4009355,40)&&cm.haveItem(4009356,20)&&cm.haveItem(4009347,5)&&cm.haveItem(4009350,1)) {
                    cm.gainItem(4009354, -40);
                    cm.gainItem(4009355, -40);
                    cm.gainItem(4009356, -20);
                    cm.gainItem(4009347, -5);
                    cm.gainItem(4009350, -1);
                    cm.gainItem(2048716, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
         } else if (selection == 6) {
                if (cm.haveItem(4009354,40)&&cm.haveItem(4009355,40)&&cm.haveItem(4009356,24)&&cm.haveItem(4009348,3)&&cm.haveItem(4009349,1)) {
                    cm.gainItem(4009354, -40);
                    cm.gainItem(4009355, -40);
                    cm.gainItem(4009356, -25);
                    cm.gainItem(4009349, -3);
                    cm.gainItem(4009348, -1);
                    cm.gainItem(2048311, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                          } else if (selection == 7) {
                if (cm.haveItem(4009354,30)&&cm.haveItem(4009355,30)&&cm.haveItem(4009356,20)&&cm.haveItem(4009348,3)&&cm.haveItem(4009353,10)) {
                    cm.gainItem(4009354, -30);
                    cm.gainItem(4009355, -30);
                    cm.gainItem(4009356, -20);
                    cm.gainItem(4009348, -3);
                    cm.gainItem(4009353, -10);
                    cm.gainItem(2049705, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                          } else if (selection == 8) {
                if (cm.haveItem(4009356,40)&&cm.haveItem(4009346,60)&&cm.haveItem(4009348,20)&&cm.haveItem(4009351,30)&&cm.haveItem(4009352,20)&& cm.haveItem(4009353,5)) {
                    cm.gainItem(4009356, -40);
                    cm.gainItem(4009346, -60);
                    cm.gainItem(4009348, -20);
                    cm.gainItem(4009351, -30);
                    cm.gainItem(4009352, -20);
                    cm.gainItem(4009353, -5);
                    cm.gainItem(2434390, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                          } else if (selection == 9) {
                if (cm.haveItem(4009356,50)&&cm.haveItem(4009346,60)&&cm.haveItem(4009347,30)&&cm.haveItem(4009351,30)&&cm.haveItem(4009352,20)&& cm.haveItem(4009353,5)) {
                    cm.gainItem(4009356, -50);
                    cm.gainItem(4009346, -60);
                    cm.gainItem(4009347, -20);
                    cm.gainItem(4009351, -30);
                    cm.gainItem(4009352, -20);
                    cm.gainItem(4009353, -5);
                    cm.gainItem(2434391, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                       } else if (selection == 10) {
                if (cm.haveItem(4009355,60)&&cm.haveItem(4009356,30)&&cm.haveItem(4009345,60)&&cm.haveItem(4009347,20)&&cm.haveItem(4009351,40)) {
                    cm.gainItem(4009355, -60);
                    cm.gainItem(4009356, -30);
                    cm.gainItem(4009345, -60);
                    cm.gainItem(4009347, -20);
                    cm.gainItem(4009351, -40);

                    cm.gainItem(3015276, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                       } else if (selection == 11) {
                if (cm.haveItem(4009354,60)&&cm.haveItem(4009355,40)&&cm.haveItem(4009345,50)&&cm.haveItem(4009346,50)&&cm.haveItem(4009352,30)) {
                    cm.gainItem(4009354, -60);
                    cm.gainItem(4009355, -40);
                    cm.gainItem(4009345, -50);
                    cm.gainItem(4009346, -50);
                    cm.gainItem(4009352, -30);

                    cm.gainItem(3015277, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                       } else if (selection == 12) {
                if (cm.haveItem(4009354,80)&&cm.haveItem(4009356,35)&&cm.haveItem(4009347,35)&&cm.haveItem(4009349,5)&&cm.haveItem(4009353,10)) {
                    cm.gainItem(4009354, -80);
                    cm.gainItem(4009356, -35);
                    cm.gainItem(4009347, -35);
                    cm.gainItem(4009349, -5);
                    cm.gainItem(4009353, -10);

                    cm.gainItem(3015278, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                       } else if (selection == 13) {
                if (cm.haveItem(4009354,100)&&cm.haveItem(4009356,40)&&cm.haveItem(4009347,60)&&cm.haveItem(4009349,20)&&cm.haveItem(4009350,4)&&cm.haveItem(4009353,15)) {
                    cm.gainItem(4009354, -100);
                    cm.gainItem(4009356, -40);
                    cm.gainItem(4009347, -60);
                    cm.gainItem(4009349, -20);
                    cm.gainItem(4009350, -4);
                    cm.gainItem(4009353, -15);

                    cm.gainItem(3015279, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                       } else if (selection == 14) {
                if (cm.haveItem(4009345,40)&&cm.haveItem(4009346,20)&&cm.haveItem(4009347,15)&&cm.haveItem(4009351,20)&&cm.haveItem(4009352,10)&&cm.haveItem(4009353,5)) {
                    cm.gainItem(4009354, -40);
                    cm.gainItem(4009356, -20);
                    cm.gainItem(4009347, -15);
                    cm.gainItem(4009349, -20);
                    cm.gainItem(4009352, -10);
                    cm.gainItem(4009353, -5);

                    cm.gainItem(2434389, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
                       } else if (selection == 15) {
                if (cm.haveItem(4009345,60)&&cm.haveItem(4009349,4)&&cm.haveItem(4009350,2)&&cm.haveItem(4009351,30)&&cm.haveItem(4009352,25)) {
                    cm.gainItem(4009345, -60);
                    cm.gainItem(4009349, -4);
                    cm.gainItem(4009350, -2);
                    cm.gainItem(4009351, -30);
                    cm.gainItem(4009352, -25);


                    cm.gainItem(1050388, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 16) {
                if (cm.haveItem(4009345,60)&&cm.haveItem(4009349,4)&&cm.haveItem(4009350,2)&&cm.haveItem(4009351,30)&&cm.haveItem(4009352,25)) {
                    cm.gainItem(4009345, -60);
                    cm.gainItem(4009349, -4);
                    cm.gainItem(4009350, -2);
                    cm.gainItem(4009351, -30);
                    cm.gainItem(4009352, -25);


                    cm.gainItem(1051458, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 17) {
                if (cm.haveItem(4009356,60)&&cm.haveItem(4009345,60)&&cm.haveItem(4009348,30)&&cm.haveItem(4009349,8)&&cm.haveItem(4009350,4)&&cm.haveItem(4009353,30)) {
                    cm.gainItem(4009345, -60);
                    cm.gainItem(4009349, -60);
                    cm.gainItem(4009350, -30);
                    cm.gainItem(4009351, -8);
                    cm.gainItem(4009352, -4);
                    cm.gainItem(4009352, -30);


                    cm.gainItem(1004597, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 18) {
                if (cm.haveItem(4009356,20)&&cm.haveItem(4009345,40)&&cm.haveItem(4009346,20)&&cm.haveItem(4009347,16)&&cm.haveItem(4009349,1)&&cm.haveItem(4009351,10)) {
                    cm.gainItem(4009356, -20);
                    cm.gainItem(4009345, -40);
                    cm.gainItem(4009346, -20);
                    cm.gainItem(4009347, -16);
                    cm.gainItem(4009349, -1);
                    cm.gainItem(4009351, -10);


                    cm.gainItem(1082666, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 19) {
                if (cm.haveItem(4009356,25)&&cm.haveItem(4009345,40)&&cm.haveItem(4009348,30)&&cm.haveItem(4009349,20)&&cm.haveItem(4009350,1)&&cm.haveItem(4009353,30)) {
                    cm.gainItem(4009356, -25);
                    cm.gainItem(4009345, -40);
                    cm.gainItem(4009348, -30);
                    cm.gainItem(4009349, -20);
                    cm.gainItem(4009350, -1);
                    cm.gainItem(4009353, -30);


                    cm.gainItem(1073090, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 20) {
                if (cm.haveItem(4009356,60)&&cm.haveItem(4009345,60)&&cm.haveItem(4009348,30)&&cm.haveItem(4009349,8)&&cm.haveItem(4009350,4)&&cm.haveItem(4009353,30)) {
                    cm.gainItem(4009345, -60);
                    cm.gainItem(4009349, -60);
                    cm.gainItem(4009350, -30);
                    cm.gainItem(4009351, -8);
                    cm.gainItem(4009352, -4);
                    cm.gainItem(4009352, -30);


                    cm.gainItem(1004598, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 21) {
                if (cm.haveItem(4009356,20)&&cm.haveItem(4009345,40)&&cm.haveItem(4009346,20)&&cm.haveItem(4009347,16)&&cm.haveItem(4009349,1)&&cm.haveItem(4009351,10)) {
                    cm.gainItem(4009356, -20);
                    cm.gainItem(4009345, -40);
                    cm.gainItem(4009346, -20);
                    cm.gainItem(4009347, -16);
                    cm.gainItem(4009349, -1);
                    cm.gainItem(4009351, -10);


                    cm.gainItem(1082667, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 22) {
                if (cm.haveItem(4009356,25)&&cm.haveItem(4009345,40)&&cm.haveItem(4009348,30)&&cm.haveItem(4009349,20)&&cm.haveItem(4009350,1)&&cm.haveItem(4009353,30)) {
                    cm.gainItem(4009356, -25);
                    cm.gainItem(4009345, -40);
                    cm.gainItem(4009348, -30);
                    cm.gainItem(4009349, -20);
                    cm.gainItem(4009350, -1);
                    cm.gainItem(4009353, -30);


                    cm.gainItem(1073091, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 23) {
                if (cm.haveItem(4009356,60)&&cm.haveItem(4009345,60)&&cm.haveItem(4009348,30)&&cm.haveItem(4009349,8)&&cm.haveItem(4009350,4)&&cm.haveItem(4009353,30)) {
                    cm.gainItem(4009345, -60);
                    cm.gainItem(4009349, -60);
                    cm.gainItem(4009350, -30);
                    cm.gainItem(4009351, -8);
                    cm.gainItem(4009352, -4);
                    cm.gainItem(4009352, -30);


                    cm.gainItem(1004599, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 24) {
                if (cm.haveItem(4009356,20)&&cm.haveItem(4009345,40)&&cm.haveItem(4009346,20)&&cm.haveItem(4009347,16)&&cm.haveItem(4009349,1)&&cm.haveItem(4009351,10)) {
                    cm.gainItem(4009356, -20);
                    cm.gainItem(4009345, -40);
                    cm.gainItem(4009346, -20);
                    cm.gainItem(4009347, -16);
                    cm.gainItem(4009349, -1);
                    cm.gainItem(4009351, -10);


                    cm.gainItem(1082668, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 25) {
                if (cm.haveItem(4009356,25)&&cm.haveItem(4009345,40)&&cm.haveItem(4009348,30)&&cm.haveItem(4009349,20)&&cm.haveItem(4009350,1)&&cm.haveItem(4009353,30)) {
                    cm.gainItem(4009356, -25);
                    cm.gainItem(4009345, -40);
                    cm.gainItem(4009348, -30);
                    cm.gainItem(4009349, -20);
                    cm.gainItem(4009350, -1);
                    cm.gainItem(4009353, -30);


                    cm.gainItem(1073092, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠!");
                    cm.dispose();
                }
 } else if (selection == 26) {
var maxNum = 8;  
var minNum = 0;  
var n = Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;  
var tz = 2591509+n;       
 if (cm.haveItem(4009356,60)&&cm.haveItem(4009346,70)&&cm.haveItem(4009347,30)&&cm.haveItem(4009351,30)&&cm.haveItem(4009352,20)&&cm.haveItem(4009353,5)) {
                    cm.gainItem(4009356, -60);
                    cm.gainItem(4009346, -70);
                    cm.gainItem(4009347, -30);
                    cm.gainItem(4009341, -30);
                    cm.gainItem(4009352, -20);
                    cm.gainItem(4009353, -5);


                    cm.gainItem(tz, 1);
                    cm.sendOk("兌換成功!");

                    cm.dispose();
                } else {
                    cm.sendOk("你身上材料不足夠23!");
                    cm.dispose();
                }
            } 
            

}
}
}
